<?php
$html = <<<EOD
EOD;

$html=file_get_contents('../../tpl/domtext.htm');

$dom = new DOMDocument;

/*
	'struct'=>'about/status',
	'page'=>'status',
	'frame'=>'inside',
	''
	res=array(
		'control1'=>array(
			'class'=>'list_viewer',
			'dir_name'=>'',
			'vars'=>''
			'tpl'=>'',
			'sections'=>'a_id=any&a2=1&a3=any',
			'cut'=>'a_text=200',
			
		)
	}
*/


function get_subs($el,$tag='param'){
	$lst=$el->getElementsByTagName ( $tag );
	//echo '<pre>',print_r( $lst ,true),'</pre>';
	$rs=array();
	for(  $i=0; $i<$lst->length; $i++ ) $rs[]=$lst;
	echo '<pre>',print_r( $rs ,true),'</pre>';
}

// load the XML string defined above
$dom->loadXML($html);
$tst=$dom->getElementsByTagName('fieldset');
foreach($tst as $el){
	echo '<h2>',$el->getAttribute ( 'name' ).'</h2>';
	foreach( $el->getElementsByTagName ( '*' ) as $sel )
		echo '<li>',$sel->getAttribute ( 'name' ).'</li>';
}


?> 